package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.DishDTO;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.AutoFill;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {

    Page<Dish> page(DishPageQueryDTO dish);
    @AutoFill(value = OperationType.INSERT)
    void insert(Dish dish);

    @Select("select * from dish where id = #{id}")
    DishDTO getById(Long id);
    @AutoFill(value = OperationType.UPDATE)
    void update(Dish dish);

    void delete(List<Long> idList);
    @Select("select * from dish where id = #{id}")
    Dish get(Long id);
    List<Dish> list(Integer categoryId);

    List<Dish> getlist(Dish dish);
}
